﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Aho.PathEditor.Gui
{
    public partial class mainwindow : Form
    {
        public mainwindow()
        {
            InitializeComponent();
            this.accessScopeDataGridViewTextBoxColumn.Items.Add(Aho.PathEditor.Business.Entities.PathScope.System);
            this.accessScopeDataGridViewTextBoxColumn.Items.Add(Aho.PathEditor.Business.Entities.PathScope.User);
            this.accessScopeDataGridViewTextBoxColumn.Items.Add(Aho.PathEditor.Business.Entities.PathScope.Undefined);
           
        }

        private void mainwindow_Load(object sender, EventArgs e)
        {
            this.DataReload();
        }

        private void neuLadenToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.DataReload();
        }

        private void speichernToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.DataSave();
        }

        private void dg_Path_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
        {
            if (this.dg_Path.CurrentCellAddress.X == 0)
            {
                TextBox txtbox = e.Control as TextBox;
                if (txtbox != null)
                {
                    txtbox.AutoCompleteSource = AutoCompleteSource.FileSystemDirectories;
                    txtbox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
                }
            }
        }


    }
}
